home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-08 | 52.0 KB | 1,345 lines | [TEXT/R*ch] |
- C.S.M.P. Digest Sun, 08 Nov 92 Volume 1 : Issue 210
-
- Today's Topics:
-
- Sound Manager
-
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- The digest is a collection of article threads from the internet newsgroup
- comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi-
- regularly and want an archive of the discussions. If you don't know what a
- newsgroup is, you probably don't have access to it. Ask your systems
- administrator(s) for details. (This means you can't post questions to the
- digest.)
-
- Each issue of the digest contains one or more sets of articles (called
- threads), with each set corresponding to a 'discussion' of a particular
- subject. The articles are not edited; all articles included in this digest
- are in their original posted form (as received by our news server at
- cs.uoregon.edu). Article threads are not added to the digest until the last
- article added to the thread is at least one month old (this is to ensure that
- the thread is dead before adding it to the digest). Article threads that
- consist of only one message are generally not included in the digest.
-
- The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
- [128.223.8.8] in the directory /pub/mac/csmp-digest. Be sure to read the
- file /pub/mac/csmp-digest/README before downloading any files. The most
- recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
- directory /info-mac/digest/csmp. If you don't have ftp capability, the sumex
- archive has a mail server; send a message with the text '$MACarch help' (no
- quotes) to LISTSERV@ricevm1.rice.edu for more information.
-
- The digest is also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new issue as it is created. Sorry, back issues
- are not available through the mailing list.
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
-
- -------------------------------------------------------
-
- From: edw@caligula.cts.com (Ed Watkeys)
- Subject: Sound Manager
- Date: 18 May 92 11:57:29 GMT
- Organization: Distant Software
-
- Is there some trick to installing voices in a sampledSynth channel? I've been
- playing, and I can't seem to avoid a bus error. This is what I'm doing more
- or less:
-
- mySample = GetResource('snd ',19000);
- if (mySample == NULL || ResErr)
- ExitToShell;
-
- HLock(mySample);
-
- myCmd.cmd = soundCmd;
- myCmd.param1 = 0;
- myCmd.param2 = (long) *mySample;
-
- if (SndDoCommand(myChannel,&myCmd,false) <> noErr)
- ExitToShell;
-
- myCmd.cmd = freqDurationCmd;
- myCmd.param1 = 2000;
- myCmd.param2 = 60;
-
- /* and I get a bus error in this line: */
- if (SndDoCommand(myChannel,&myCmd,false) <> noErr)
- ExitToShell;
-
- What I'm doing is very simple, and a lot of my code is IM VI code translated
- into C. I have a channel open at this point, using IM VI sample code. If I
- change sampledSynth to the square wave synth and remove the code to install
- a voice, everything works fine.
-
- Also, does anyone know if there are tech notes dealing with the Sound Manager?
- If so, are they post-IM VI, or do they cover information that was out into
- IM VI?
-
- Thanks loads,
- Ed
-
- - --
- Ed Watkeys (Drexel U. Comp Sci) "Moral judgement and condemnation is
- edw@caligula.cts.com the favorite form of revenge for the
- edw%caligula@phlpa.pha.pa.us spiritually limited on those who are
- ls.com!phlpa!caligula!edw less so...." -- Friedrich Nietzsche
-
- +++++++++++++++++++++++++++
-
- From: REEKES@applelink.apple.com (Jim Reekes)
- Date: 19 May 92 19:42:59 GMT
- Organization: Apple Computer, Inc.
-
- In article <01050133.3q4v99@caligula.cts.com>, edw@caligula.cts.com (Ed Watkeys) writes:
- >
- > Is there some trick to installing voices in a sampledSynth channel? I've been
- > playing, and I can't seem to avoid a bus error. This is what I'm doing more
- > or less:
- >
- > mySample = GetResource('snd ',19000);
- > if (mySample == NULL || ResErr)
- > ExitToShell;
- >
- > HLock(mySample);
- >
- > myCmd.cmd = soundCmd;
- > myCmd.param1 = 0;
- > myCmd.param2 = (long) *mySample;
- >
- > if (SndDoCommand(myChannel,&myCmd,false) <> noErr)
- > ExitToShell;
- >
- > myCmd.cmd = freqDurationCmd;
- > myCmd.param1 = 2000;
- > myCmd.param2 = 60;
- >
- > /* and I get a bus error in this line: */
- > if (SndDoCommand(myChannel,&myCmd,false) <> noErr)
- > ExitToShell;
- >
- > What I'm doing is very simple, and a lot of my code is IM VI code translated
- > into C. I have a channel open at this point, using IM VI sample code. If I
- > change sampledSynth to the square wave synth and remove the code to install
- > a voice, everything works fine.
- >
- > Also, does anyone know if there are tech notes dealing with the Sound Manager?
- > If so, are they post-IM VI, or do they cover information that was out into
- > IM VI?
- >
- > Thanks loads,
- > Ed
-
- 1. You don't point at the 'snd ' resource for the soundCmd. You pass a
- pointer to the sound header contained within the resource.
-
- SoundApp demonstrates how to do all of this. It's official MacDTS sample
- code. It's been available for a few years. Inside Mac VI is the only
- documentation to read. The rest is covered in the sample code.
-
-
- - -----------------------------------------------------------------------
- Jim Reekes, Polterzeitgeist | Macintosh Toolbox Engineering
- | Sound Manager Expert
- Apple Computer, Inc. | "All opinions expressed are mine, and do
- 20525 Mariani Ave. MS: 81-KS | not necessarily represent those of my
- Cupertino, CA 95014 | employer, Apple Computer Inc."
-
- +++++++++++++++++++++++++++
-
- From: udsugar@mcs.drexel.edu (David Sugar)
- Date: 6 Jun 92 04:49:16 GMT
- Organization: Drexel University, Dept. of Math. and Comp. Sci.
-
-
- I have what I hope is a farily simple question on using a Sound Manager
- call. The call in question is SPBGetDeviceInfo. I am having trouble when
- I use either the selector siActiveChannels or siActiveLevels. I have
- read the little description in IM VI many time and I don't understand
- what it means by "When setting the active channels, the data passed in
- is a long integer etc... I keep getting the error back of -231. But
- any of the other calls that I make with different selectors are ok.
- I have already opened the sound input device with no problem and have
- the refNum and I can get the number of channels and all that stuff, but
- not this ActiveChannels or ActiveLevels. Here is what I have right now,
- keep in mind that I'm just doing some playing around with it right now,
- I will be adding error checking etc in when I get the basic stuff to actually
- work.
-
- void GetMiscInfo(long refNum)
- {
- OSErr err;
- int chav,chan,lmet,lmac;
- long chac;
-
- lmet=1;
- chac=0x00000000; /*??? I did this just becuase I wasn't sure what to do*/
- err=SPBGetDeviceInfo(refNum,siChannelAvailable,(char) *)&chav); /*works*/
- if (chav >=2)
- chan=2;
- else
- chan=1;
- err=SPBSetDeviceInfo(refNum,siNumberChannels,(char *)&chan); /*works*/
- err=SPBSetDeviceInfo(refNum,siLevelMeterOnOff,(char *)&lmet); /*works*/
- err=SPBSetDeviceInfo(refNum,siDeviceBufferInfo,(char *)&chac); /* error */
- err=SPBGetDeviceInfo(refNum,siActiveLevels,(char *)&lmac); /* error */
- }
-
- Of the 2 lines that get errors I have a feeling that the second one, the
- call to siActiveLevels is becuase the active channels wasn't set correctly
- in the previous call. But, I'm not sure how to set the varialbe chac etc
- to get it to work..
- Does anyone have any idea on what I'm doing wrong??
-
- Thanks
-
- Dave Sugar
- udsugar@mcs.drexel.edu
-
- +++++++++++++++++++++++++++
-
- From: REEKES@applelink.apple.com (Jim Reekes)
- Date: 9 Jun 92 07:33:33 GMT
- Organization: Apple Computer, Inc.
-
- In article <1992Jun6.044916.13034@mcs.drexel.edu>, udsugar@mcs.drexel.edu (David Sugar) writes:
- >
- >
- > I have what I hope is a farily simple question on using a Sound Manager
- > call. The call in question is SPBGetDeviceInfo. I am having trouble when
- > I use either the selector siActiveChannels or siActiveLevels. I have
- > read the little description in IM VI many time and I don't understand
- > what it means by "When setting the active channels, the data passed in
- > is a long integer etc... I keep getting the error back of -231. But
- > any of the other calls that I make with different selectors are ok.
- > I have already opened the sound input device with no problem and have
- > the refNum and I can get the number of channels and all that stuff, but
- > not this ActiveChannels or ActiveLevels. Here is what I have right now,
- > keep in mind that I'm just doing some playing around with it right now,
- > I will be adding error checking etc in when I get the basic stuff to actually
- > work.
- >
- > void GetMiscInfo(long refNum)
- > {
- > OSErr err;
- > int chav,chan,lmet,lmac;
- > long chac;
- >
- > lmet=1;
- > chac=0x00000000; /*??? I did this just becuase I wasn't sure what to do*/
- > err=SPBGetDeviceInfo(refNum,siChannelAvailable,(char) *)&chav); /*works*/
- > if (chav >=2)
- > chan=2;
- > else
- > chan=1;
- > err=SPBSetDeviceInfo(refNum,siNumberChannels,(char *)&chan); /*works*/
- > err=SPBSetDeviceInfo(refNum,siLevelMeterOnOff,(char *)&lmet); /*works*/
- > err=SPBSetDeviceInfo(refNum,siDeviceBufferInfo,(char *)&chac); /* error */
- > err=SPBGetDeviceInfo(refNum,siActiveLevels,(char *)&lmac); /* error */
- > }
- >
- > Of the 2 lines that get errors I have a feeling that the second one, the
- > call to siActiveLevels is becuase the active channels wasn't set correctly
- > in the previous call. But, I'm not sure how to set the varialbe chac etc
- > to get it to work..
- > Does anyone have any idea on what I'm doing wrong??
-
- Never, never, EVER, pass a type int to the Mac toolbox. In MPW the int
- is four bytes long, but in Think C they used to be two bytes. With the
- new version of Think they can be either two or four bytes depending on
- your preferences.
-
- The proper thing to pass each of these selectors are:
-
- siChannelAvailable short
- siNumberChannels short
- siLevelMeterOnOff short
- siDeviceBufferInfo long
- siActiveLevels long
-
- The next thing is that error -231 means the selector is not supported,
- thus the name "siUnknownInfoType".
-
- So, if you get the error it means it's not going to work with the current
- driver. The Apple Sound Input driver does not support setting either
- siDeviceBufferInfo or siActiveLevels.
-
- Below are some examples of calling SPBGetDeviceInfo and SPBSetDeviceInfo.
-
-
- long GetBufferLength(void)
- {
- long bufferLength;
- OSErr err;
-
- err = SPBGetDeviceInfo(gSndInputRef, siDeviceBufferInfo, (Ptr)&bufferLength);
- if (err == noErr) // noErr
- return (bufferLength);
- else
- return (0);
- }
-
- short GetVoxStopData(void)
- {
- short VoxData[3];
- OSErr err;
-
- err = SPBGetDeviceInfo(gSndInputRef, siVoxStopInfo, (Ptr)VoxData);
- if ( (err == noErr) && (VoxData[0]) ) // noErr and Vox Stop is on
- return (VoxData[1]);
- else
- return (0);
- }
-
- void SetVoxStop(short value)
- {
- short VoxData[3];
- OSErr err;
-
- if (value > 0)
- VoxData[0] = 1; // turn it on
- else
- VoxData[0] = 0; // turn it on
- VoxData[1] = value;
- VoxData[2] = GetVoxDelayData();
- err = SPBSetDeviceInfo(gSndInputRef, siVoxStopInfo, (Ptr) VoxData);
- if (err)
- AlertUser(err, eSndInMgr, !kFatalError);
- }
-
- void SetVoxDelay(short value)
- {
- short VoxData[3];
- OSErr err;
-
- VoxData[0] = 1; // turn it on
- VoxData[1] = GetVoxStopData();
- VoxData[2] = value;
- err = SPBSetDeviceInfo(gSndInputRef, siVoxStopInfo, (Ptr) VoxData);
- if (err)
- AlertUser(err, eSndInMgr, !kFatalError);
- }
-
- short GetVoxDelayData(void)
- {
- short VoxData[3];
- OSErr err;
-
- err = SPBGetDeviceInfo(gSndInputRef, siVoxStopInfo, (Ptr)VoxData);
- if ( (err == noErr) && (VoxData[0]) ) // noErr and Vox Stop is on
- return (VoxData[2]);
- else
- return (0);
- }
-
- short SetLevelMetering(Boolean on)
- {
- OSErr err;
- short metering;
-
- if (on)
- metering = 1; // turn it on
- else
- metering = 0; // turn it off
- err = SPBSetDeviceInfo(gSndInputRef, siLevelMeterOnOff, (Ptr)&metering);
- if (err)
- AlertUser(err, eSndInMgr, !kFatalError);
- }
-
- short GetCurLevel(void)
- {
- OSErr err;
- short meterData[2];
-
- err = SPBGetDeviceInfo(gSndInputRef, siLevelMeterOnOff, (Ptr) meterData);
- if ((err == noErr) && meterData[0]) // no error and level metering on
- return (meterData[1]);
- else
- return (0);
- }
-
-
-
- - -----------------------------------------------------------------------
- Jim Reekes, Polterzeitgeist | Macintosh Toolbox Engineering
- | Sound Manager Expert
- Apple Computer, Inc. | "All opinions expressed are mine, and do
- 20525 Mariani Ave. MS: 81-KS | not necessarily represent those of my
- Cupertino, CA 95014 | employer, Apple Computer Inc."
-
-
-
- +++++++++++++++++++++++++++
-
- From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
- Date: 11 Jun 92 19:05:12 GMT
- Organization: MSD
-
- I have a MacApp/Sound Manager problem that is driving me craaaazy!
-
- I *thought* I understood how the Sound Manager worked, but there's one
- sticky point with which I am having problems. My application records
- audio using the standard sound input routines, and the audio can be
- uncompressed or compressed 3:1 or 6:1. No problem there. I save
- it to a file. Now, I want to play back arbitrary portions of it,
- based on a user selection. The standard technique for playing
- an audio selection doesn't suffice, since you can only specify
- 'play from X seconds in the audio to Y seconds' and I need more
- granularity than that. So here's how I do it:
-
- 1. When play is selected, determine start and stop
- bytes of the audio
-
- 2. Create a sound channel. For uncompressed it's like this:
- FailOSErr(SndNewChannel(gSCPtr, sampledSynth, initMono, @MarkBuffersFree));
- Otherwise it's like this:
- FailOSErr(SndNewChannel(gSCPtr, sampledSynth, initMono + initMACE3 + initMACE6, ...
- Call SetupSndHeader with the proper parameters for my audio buffers
-
- 3. Play audio using a number of buffers:
- 3a. Read audio data from file and shove into current audio buffer.
- 3b. Schedule a callback. When it gets called, it simply
- marks the buffer as 'available' once more.
- 3c. Go back to 3a until audio is done.
-
- <Note: step 3 is done using MacApp's Idle mechanism>
-
- 4. When audio is done, kill the channel.
-
- Here FINALLY is the problem: when I play audio that was recorded
- at 3:1 or 6:1 compression this technique works great. However, when I
- play audio that was recorded uncompressed, you can (faintly) hear the
- original audio, but you hear LOUD scratches/noise. The question:
- what's going on, and how can I fix this problem?
-
- A solution that doesn't involve me changing all 8.5 million lines of
- code for this project would be a good one :).
-
- Any ideas would be appreciated!
-
- Thanks!
-
- chuck
-
- --chuck mcmath-
- mcmath@csb1.nlm.nih.gov
- MSD, Inc. * National Library of Medicine * National Institutes of Health
- Bethesda, MD 20894
-
- "Hey batter, hey batter, hey batter, swing" - Anon.
-
- +++++++++++++++++++++++++++
-
- From: cfejm@ux1.cts.eiu.edu (John Miller)
- Date: Wed, 17 Jun 1992 16:24:06 GMT
- Organization: Eastern Illinois University
-
- Hi All,
-
- The situation: I've created a shell to explore musical playback using the
- Sound Manager. A simple melody is successfully played back on a Mac II
- using System 7 using each of the three synths--sampled, square, and
- wave-table, compiled and run separately.
-
- The problem: The same program running on a Plus and an SE under 6.0.5,
- 6.0.7, and 6.0.8 is successful playing back the sampled and square-wave
- example, but has strange results when using the wave-table synth--the
- example does not start at the beginning, and occasional other
- irregularities (wrong octave) result.
-
- Any advice?
-
- Thanks in advance
-
-
- John
-
-
- - --
- John Miller
- Music Theory
- Eastern Illinois University
-
- +++++++++++++++++++++++++++
-
- From: potts@itl.itd.umich.edu (Paul Potts)
- Organization: Instructional Technology Laboratory, University of Michigan
- Date: Wed, 17 Jun 92 21:59:19 GMT
-
- In article <1992Jun17.162406.29904@ux1.cts.eiu.edu> cfejm@ux1.cts.eiu.edu (John Miller) writes:
- >Hi All,
- >
- >The situation: I've created a shell to explore musical playback using the
- >Sound Manager. A simple melody is successfully played back on a Mac II
- >using System 7 using each of the three synths--sampled, square, and
- >wave-table, compiled and run separately.
- >
- >The problem: The same program running on a Plus and an SE under 6.0.5,
- >6.0.7, and 6.0.8 is successful playing back the sampled and square-wave
- >example, but has strange results when using the wave-table synth--the
- >example does not start at the beginning, and occasional other
- >irregularities (wrong octave) result.
-
- First off, I wouldn't attempt to do much with the sound manager under 6.0.5.
- Stick with 6.0.7 or above, which has a later version.
-
- The wave-table synth is a little weird, but I've had some luck with it.
- You aren't trying to pass it real frequency values, are you? Use only MIDI
- note values. Passing real frequency values will cause strange results.
- The documentation was wrong about this for some time, but I-M 7 has it
- right.
-
- Other than that, maybe post some code?
-
-
- - --
- The essence of OOP: "With all this horse manure, I know there's got to be
- a pony in here somewhere!"
- Paul R. Potts, Software Designer --- potts@itl.itd.umich.edu <--- me!
-
- +++++++++++++++++++++++++++
-
- From: REEKES@applelink.apple.com (Jim Reekes)
- Date: 25 Jun 92 01:05:03 GMT
- Organization: Apple Computer, Inc.
-
- In article <1992Jun17.162406.29904@ux1.cts.eiu.edu>, cfejm@ux1.cts.eiu.edu (John Miller) writes:
- >
- > Hi All,
- >
- > The situation: I've created a shell to explore musical playback using the
- > Sound Manager. A simple melody is successfully played back on a Mac II
- > using System 7 using each of the three synths--sampled, square, and
- > wave-table, compiled and run separately.
- >
- > The problem: The same program running on a Plus and an SE under 6.0.5,
- > 6.0.7, and 6.0.8 is successful playing back the sampled and square-wave
- > example, but has strange results when using the wave-table synth--the
- > example does not start at the beginning, and occasional other
- > irregularities (wrong octave) result.
- >
- > Any advice?
- >
-
- The wave table channels do not work on "classic" hardware not running the
- new Sound Manager. These are the Plus, SE, or Classic under a system
- older than 6.0.7. Also, you should try your code under System 7.0.
- I'm certain that 7.0 sound manager is going to work for you.
-
- "Make is suck less" is the motto.
-
- - -----------------------------------------------------------------------
- Jim Reekes, Polterzeitgeist | Macintosh Toolbox Engineering
- | Sound Manager Expert
- Apple Computer, Inc. | RAll opinions expressed are mine, and do
- 20525 Mariani Ave. MS: 81-KS | not necessarily represent those of my
- Cupertino, CA 95014 | employer, Apple Computer Inc.S
-
-
-
- +++++++++++++++++++++++++++
-
- From: davisw@aurs01.uucp (Walt Davis)
- Date: 8 Jul 92 22:42:11 GMT
- Organization: Alcatel Network Systems, Raleigh NC
-
- I'm new in sound-programming game and I'm having problems getting some
- of my simple, asynchronous (or synchronous for that matter) sound
- manager code to behave properly on 68000-based SEs and Pluses. All I'm
- trying to do is play little 'snd ' resources (type 1) on sampledSynth
- sound channels. Everything works fine on IIs and up. Obviously I'm
- missing something obvious. I suspect some type of sound-manager
- incompatibilities (couldn't be me ;-)). SOS...
-
- Walt Davis
- davisw%aurfs1%aurgate@mcnc.org
- AOL: DavisW
-
- +++++++++++++++++++++++++++
-
- From: mlanett@Apple.COM (Mark Lanett)
- Date: 9 Jul 92 07:20:58 GMT
- Organization: Apple Computer Inc., Cupertino, CA
-
- davisw@aurs01.uucp (Walt Davis) writes:
-
- >I'm new in sound-programming game and I'm having problems getting some
- >of my simple, asynchronous (or synchronous for that matter) sound
- >manager code to behave properly on 68000-based SEs and Pluses. All I'm
- >trying to do is play little 'snd ' resources (type 1) on sampledSynth
- >sound channels. Everything works fine on IIs and up. Obviously I'm
- >missing something obvious. I suspect some type of sound-manager
- >incompatibilities (couldn't be me ;-)). SOS...
-
- Try hardware incompatibilities. Pluses and SEs don't have the sound chip
- required for some things like play from disk and playing multiple sound
- channels. Having only spent 3 days or so tinkering with the Sound Manager I'm
- not clear on what exactly won't work, however.
- - --
- Have a bajillion brilliant Jobsian lithium licks.
- Mark Lanett
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Organization: Kalamazoo College
- Date: Thu, 9 Jul 1992 13:07:52 GMT
-
- mlanett@Apple.COM (Mark Lanett) writes:
- >davisw@aurs01.uucp (Walt Davis) writes:
- >
- >>I'm new in sound-programming game and I'm having problems getting some
- >>of my simple, asynchronous (or synchronous for that matter) sound
- >>manager code
-
- "Simple, asynchronous sound manager code" is oxymoronic...
-
- >>to behave properly on 68000-based SEs and Pluses. All I'm
- >>trying to do is play little 'snd ' resources (type 1) on sampledSynth
- >>sound channels. Everything works fine on IIs and up. Obviously I'm
- >>missing something obvious. I suspect some type of sound-manager
- >>incompatibilities (couldn't be me ;-)).
- >
- >Try hardware incompatibilities. Pluses and SEs don't have the sound chip
- >required for some things like play from disk and playing multiple sound
- >channels.
-
- There are many and various things which can go wrong when you try to
- play sound. I don't think we can blame anything in particular at this
- point.
-
- Mark, make sure you're using the same system on all machines; 6.0.7 or
- 7 would be best. Don't use Macintalk or SoundMaster, and don't run any
- applications that use the Sound Driver. And post the code you're using;
- pseudo-code is OK if it's accurate.
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- I suppose ya don't think I was run over by a streetcar!
-
- +++++++++++++++++++++++++++
-
- From: ccmlh@buitc.bu.edu (Mark Hayes)
- Date: 9 Jul 92 16:34:10 GMT
- Organization: Boston University, Boston, MA, USA
-
- Since there's been some more discussion recently about sound problems,
- I'd like to re-present a problem I mentioned a while ago, with some new
- information, and again ask if anyone knows why things go as they do.
-
- This little test program runs just dandy on my SE/30 under System 7.0;
- it plays an (uncompressed) 'snd' resource ten times and exits.
- If, however, I run it on an SE/30 under System 6.0.7, or on an SE under 7.0,
- the sound plays once and only once. Here's the code:
-
- void main(void)
- {
- OSErr myErr; SndChannelPtr myChanPtr; Handle myHandle; short x;
-
- myChanPtr = nil;
- myErr = SndNewChannel(&myChanPtr, 0, 0L, nil);
- myHandle = GetNamedResource('snd ', "\pmySound");
-
- for (x = 0; x < 10; x++)
- myErr = SndPlay(myChanPtr, myHandle, false);
-
- myErr = SndDisposeChannel(myChanPtr, true);
- }
-
- Now, if I change the program so that it doesn't allocate and retain a
- channel across multiple SndPlay calls, it works on all three systems:
-
- for (x = 0; x < 10; x++)
- myErr = SndPlay(nil, myHandle, false);
-
- I know Apple recommends that one *not* retain a channel in the way I want to,
- but there definitely is a performance hit in the second program that I'd prefer
- to avoid. In the real programs I'm working on, I do de- and re-allocate the
- channel in the event of a suspend/resume, or if my own code puts up a dialog.
- And the sound plays are synchronous, so it's not (?) a timing problem.
- So why does this first sample program work on the System 7 SE/30 but not
- on the other two systems?
-
- Also, while I'm here, what, please, are the system and machine requirements
- for the use of compressed sounds with SndPlay? I believe I'm talking about
- a capability called "MACE", but I don't know what systems support it and what
- systems don't.
-
- Thanks to anyone for any help.
- Mark
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Organization: Kalamazoo College
- Date: Thu, 9 Jul 1992 18:07:32 GMT
-
- ccmlh@buitc.bu.edu (Mark Hayes) writes:
- >
- >This little test program runs just dandy on my SE/30 under System 7.0;
- >it plays an (uncompressed) 'snd' resource ten times and exits.
- >If, however, I run it on an SE/30 under System 6.0.7, or on an SE under 7.0,
- >the sound plays once and only once. Here's the code:
- >
- > ...
- > myChanPtr = nil;
- > myErr = SndNewChannel(&myChanPtr, 0, 0L, nil);
- > for (x = 0; x < 10; x++)
- > myErr = SndPlay(myChanPtr, myHandle, false);
- > myErr = SndDisposeChannel(myChanPtr, true);
- > ...
- >
- >Now, if I change the program so that it doesn't allocate and retain a
- >channel across multiple SndPlay calls, it works on all three systems:
- >
- > for (x = 0; x < 10; x++)
- > myErr = SndPlay(nil, myHandle, false);
- >
- >I know Apple recommends that one *not* retain a channel in the way I want to,
-
- They do? I couldn't find that in IM VI...
-
- But if so, then listen to Apple and don't do it!
-
- >but there definitely is a performance hit in the second program that I'd prefer
- >to avoid.
-
- Don't use SndPlay, then. Instead, do this with the channel:
-
- SndCommand s;
- s.cmd = flushCmd;
- FailOSErr(SndDoImmediate(myChanPtr, &s));
- s.cmd = quietCmd;
- FailOSErr(SndDoImmediate(myChanPtr, &s));
- HLock(myHandle);
- s.cmd = bufferCmd;
- s.param2 = StripAddress(*myHandle) + offsetToStartOfSndBuffer(myHandle);
- FailOSErr(SndDoCommand(myChanPtr, &s, TRUE));
- // keep the handle locked until the sound completes
-
- You'll have to write the function offsetToStartOfSndBuffer() yourself.
- It's a ten-line no-brainer that takes a handle and returns the offset to
- the start of the sound buffer, which is _not_ the raw data, it's what
- immediately follows the sound commands in the 'snd ' resources.
-
- >Also, while I'm here, what, please, are the system and machine requirements
- >for the use of compressed sounds with SndPlay? I believe I'm talking about
- >a capability called "MACE", but I don't know what systems support it and what
- >systems don't.
-
- You need the system 6.0.7 or later Sound Manager to use MACE. It stands
- to reason that MACEVersion() would return nonzero if MACE is present,
- but don't hold me to that. My system 7.0.1 returns "1.0.1 final".
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- When the ship runs out of water and the vessel runs aground, land's where we
- know the boat is found. Now, there's nothing unexpected about the water
- giving out; "land"'s not a word we have to shout. -- TMBG, "Women and Men"
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Date: 10 Jul 92 13:54:43 GMT
- Organization: Kalamazoo College
-
- k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
- >ccmlh@buitc.bu.edu (Mark Hayes) writes:
- >>
- >>I know Apple recommends that one *not* retain a channel in the way I want to
- >
- >They do? I couldn't find that in IM VI...
-
- Then, davisw%aurfs1%aurgate@mcnc.org (Walt Davis) advises me via email:
- >
- >See IM VI page 22-40...
-
- Aha. The actual warning is "...sound channels are for temporary use,
- and...you should create them just before playing sounds. Once the sound
- is completed, you should dispose of the channel."
-
- Don't take this warning _too_ seriously. Most programs should follow
- it, because it's good advice: if you keep a sampledSynth sound channel
- open continuously, the user will never hear a "Simple Beep" SysBeep,
- because it uses a different synthesizer. That's just one reason why you
- should close sound channels when you don't need them.
-
- But when you do need them, don't be stingy. If you need to play ten
- noisess in a row, there's absolutely no reason why you shouldn't keep one
- channel open for all ten noises. If your arcade game has lots of sound,
- keep as many channels open as you need. Now, when the player switches you
- into the background, or otherwise pauses the action, then you should
- dispose of them. But there's no reason to get in a frenzy of religiously
- allocating and disposing SndChannels every time you play a sound.
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- When the ship runs out of water and the vessel runs aground, land's where we
- know the boat is found. Now, there's nothing unexpected about the water
- giving out; "land"'s not a word we have to shout. -- TMBG, "Women and Men"
-
- +++++++++++++++++++++++++++
-
- From: potts@itl.itd.umich.edu (Paul Potts)
- Date: 10 Jul 92 20:04:15 GMT
- Organization: Instructional Technology Laboratory, University of Michigan
-
- In article <69799@apple.Apple.COM> mlanett@Apple.COM (Mark Lanett) writes:
- >davisw@aurs01.uucp (Walt Davis) writes:
- >
- >>I'm new in sound-programming game and I'm having problems getting some
- >>of my simple, asynchronous (or synchronous for that matter) sound
- >>manager code to behave properly on 68000-based SEs and Pluses. All I'm
- >>trying to do is play little 'snd ' resources (type 1) on sampledSynth
- >>sound channels.
-
- There aren't any compatibility problems that would make it impossible to
- play a type 1 sound on a 68000-based machine. It does work - or else how would
- you be able to use a cow mooing or whatever for your system beep?
-
- Show us some code... maybe we can get a better idea that way. Keep in mind that
- it is possible a bug elsewhere could cause a crash when you call the
- sound manager. Are you checking all the error returns properly? There are
- things that you can't do with sound on the low-end macs, but the sound manager
- will usually tell you.
-
- - --
- ..though I respect that a lot, I'd be fired if that were my job, after
- killing Jason off and countless screaming argonauts... (They Might Be Giants)
- Paul R. Potts, Software Designer --- potts@itl.itd.umich.edu <--- me!
-
- +++++++++++++++++++++++++++
-
- From: Daniel E. Rudman <rudman@caen.engin.umich.edu>
- Date: Fri, 17 Jul 92 03:34:07 EDT
- Organization: The University of Michigan Ann Arbor
-
- In article <90645@bu.edu> Mark Hayes, ccmlh@buitc.bu.edu writes:
-
- > void main(void)
- > OSErr myErr; SndChannelPtr myChanPtr; Handle myHandle; short x;
- > myChanPtr = nil;
- > myErr = SndNewChannel(&myChanPtr, 0, 0L, nil);
- > myHandle = GetNamedResource('snd ', "\pmySound");
- > for (x = 0; x < 10; x++)
- > myErr = SndPlay(myChanPtr, myHandle, false);
- > myErr = SndDisposeChannel(myChanPtr, true);
- > }
-
- I don't know if this helps, but I don't think it's a really good idea to call
- SndNewChannel with 0 as your synth and your modifier; I think you should
- probably use sampleSynth and monoWhateverTheHellItIs or whatever. Zero is not
- defined in Inside Mac VI, and I wouldn't suggest using it. I've had problems
- with the Sound Manager when trying that.
-
- Also, if you ever plan on coming BACK to that section of the code (not in
- this case, obviously, but you never know) then make sure you FORCE THE
- CHANNEL POINTER TO NIL. SndNewChannel doesn't work so well when you pass it
- the remains of your disposed channel. Anyway, that doesn't happen here but I
- thought I'd mention it.
-
- - ------------------------------------------------------------
- Daniel E. Rudman
- The University of Michigan
- Computer-Aided Engineering Network
-
- +++++++++++++++++++++++++++
-
- From: danny@utkux1.utk.edu (Danny W. McCampbell)
- Date: 10 Aug 92 19:57:22 GMT
- Organization: University of Tennessee
-
- I want to thank those who responded to my question about playing simple
- sounds from within my program. Now I have more questions. If I
- understand IM Vol. VI correctly I can call SndStartFilePlay I can
- control the sound the way I want to. Right now I am just using
- SndPlay to play the sound and everything works fine except that I
- cannot proceed to do anything else until the sound (which is extremely
- large) finishes playing. I want to be able to let the sound play
- while I continue to do things within program. I tried using
- SndStartFilePlay but the error that it returns is -201 which is
- Insufficient hardware available. I have a MacII CI with 8 megs of
- ram and plenty of hard disk space. Is there something specific
- that I have to have like a microphone jack to call SndStartFilePlay?
- If anyone out there has some code laying around that would help me
- better understand what I am doing, I would greatly appreciate getting
- a look at it. I am just merely calling a modal dialog, starting a
- sound and waiting for the user to click OK. When they click OK I want
- to stop the sound and close the dialog.
-
- Thanks in advance.
-
- Sorry for being so ignorant.
-
- Danny McCampbell
- danny@utkux1.utk.edu
-
- +++++++++++++++++++++++++++
-
- From: neath@brazil.psych.purdue.edu (Ian Neath)
- Date: 10 Aug 92 20:21:39 GMT
- Organization: Psychology Department, Purdue University
-
- I recall a while back a mention about the Sound Manager chapter
- in IM 6 that implied it had been superseded. Is this correct?
- If so, where can I find how to play SND s asynchronously under
- System 7? I've found that my System 6 async code plays
- synchronously under 7. If it is accurate, I'd appreciate knowing
- that also.
-
- Thanks.
-
- - --
- Ian Neath, PhD | There are four kinds of people in this world:
- neath@psych.purdue.edu | cretins, fools, morons and lunatics - U. Eco
-
- +++++++++++++++++++++++++++
-
- From: chuck@gte.com (Chuck Hoffman)
- Date: 1 Sep 92 19:55:02 GMT
- Organization: GTE Laboratories
-
- I'm just getting into the Sound Manager and am using the simple note
- synthesizer. I created a sound resource with ResEdit (created my own 'snd
- ' template) and the sound plays fine from ResEdit and my program. Playing
- asynchronously. When the sound is done, I have a CallBackCmd to invoke my
- callback routine which simply sets a flag so that I can later dispose of
- the channel and release the sound resource. I've done this by putting the
- callback command at the end of the sound resource, and by using
- SndDoCommand to insert into the buffer. In both cases, it works correctly
- about 2 of 3 times. Can't set a THINK C debugger breakpoint in the
- callback routine because of crashes (a conflict with the memory manager?),
- but the main event loop sees the variable as if it has not been set. I've
- tried code updating the flag (in a global variable) directly, and I've
- tried passing the address of the variable to the subroutine and getting at
- it that way. Same symptom no matter what. Any ideas?
-
-
- Chuck Hoffman
- chuck@gte.com
- GTE Laboratories, Waltham, Massachusetts, USA
- (617) 466-2131
- =====================================
- I'm not sure why we're here, but I am sure that while we're here we're
- supposed to help each other.
- =====================================
-
- +++++++++++++++++++++++++++
-
- From: johnsd2@jec324.its.rpi.edu (Daniel Norman Johnson)
- Organization: Rensselaer Polytechnic Institute, Troy, NY.
- Date: Thu, 1 Oct 1992 18:35:27 GMT
-
- I am having a problem with an extension I am writing. This extension
- is really a background app (type='appe'), which plays sounds asynchronously
- in the background (which sounds are specified with annother program, that
- works);
-
- Most of the time it works fine but I am having 2 odd problems that I haven't
- been able to track down.
-
- One sound that I have, namely "Spanish Inquisition" ("<BLAM> NOOOOOOOBody
- expects the Spanish Inquisition!") Is giving me trouble. This sound
- plays synchronously just fine. Asynchronously, it SOMETIMES plays
- fine. When the appe is running as an APPL (so I can double
- click it+ don't have to restart to fool with it), it plays fine.
- When my app is running as an appe (ie normally) the sound plays
- but the extension then freezes up. Everything else continues
- working fine, but the extension will not play anything or respond
- to apple events (notably 'QUIT'- something of a pain when u r trying
- to Shut Down); This strange freeze happens on a friends LC whenever
- the sound is played, even from an APPL. (but only if its
- asynchronously)
-
- The other problem seems to be an incompatibility with AutoDoubler,
- versions 1.0.6 and 1.0.7 at least. On my friend's LC it cannot
- play Autodoubler compressed sounds. The whole system freezes if its
- tries to do so, but only if I am not trying to use the Think Pascal
- debugger on it. :( So I dont know exactly what's happeneing; maybe
- the sound is freezing when it loads or something. Is there a known
- bug in AutoDoubler that could do this? This bug does not occur
- on my system, at all.
-
- I am writing this in Think Pascal 4.0, on a Macintosh IIcx 5/100. I
- am using AutoDoubler 1.0.7 (my friend was using 1.0.6, but I got him
- the update thinking that would solve the problem. It didn't.) My
- friends LC was a 4/40 btw.
-
- Thanx in advance!
-
- - --
- - Dan Johnson
- And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
-
- These opinions have had all identifiying marks removed, and are untraceable.
- You'll never know whose they are.
-
- +++++++++++++++++++++++++++
-
- From: Matthew_J._Meyer@bmug.org
- Organization: BMUG, Inc.
- Date: Fri, 02 Oct 1992 20:41:03 PDT
-
- I ran into similar sound problems (in an 'appl' only) where I needed to
- play an async sound repeatedly (machine gun type effect). All sound on
- my LC would stop after a few cycles of the sound. I found that by adding
- a slight delay (3 - 6 ticks) before trying to replay the sound
- everything was fine. Perhaps this will help your situation...?
- ***************************************************************************
- From Planet BMUG, the FirstClass BBS of BMUG, Inc.
- The above message was gatewayed via PostalUnion
- ***************************************************************************
- The message contained in this posting is entirely the poster's personal
- opinion. Any possible, real or perceived, (dis)similarities with the
- views held by BMUG, are purely coincidental.
- ***************************************************************************
-
- +++++++++++++++++++++++++++
-
- From: dan@chaos.cs.brandeis.edu (Dan Schwarz)
- Date: 5 Oct 92 02:27:12 GMT
- Organization: Brandeis University
-
- In article <w=mz_wc@rpi.edu> johnsd2@rpi.edu writes:
- >I am having a problem with an extension I am writing. This extension
- >is really a background app (type='appe'), which plays sounds asynchronously
- >in the background (which sounds are specified with annother program, that
- >works);
- ...
- >This strange freeze happens on a friends LC whenever
- >the sound is played, even from an APPL. (but only if its
- >asynchronously)
-
- Speaking as a programmer who has done some SERIOUS sound manager hacking,
- I can sympathize with your frustration. Here's what I can tell you:
-
- * the Mac LC uses a crippled version of the Apple Sound Chip. So does the LC II
- and Classic II, by the way. Major difference is that this chip can only handle
- monophonic sound output, and cannot support simultaneous sound recording &
- playback.
-
- * the System 6.0.7 and 6.0.6 sound managers have MAJOR bugs, especially when
- dealing with the LC. These systems' sound input managers were taken directly
- from alpha versions of System 7.0 (in the rush to ship the first LC and IIsi
- units.) Don't trust the Gestalt values they return, for example.
-
- * Use 7.0 or later versions, but this won't solve all your problems. I am
- convinced that there are hardware or software bugs in Apple's handling of
- this particular sound chip. For example, play back a QuickTime movie with
- sound (in SimplePlayer or any similar product.) Switch out of the layer
- into a product which does sound recording or otherwise uses the sound manager.
- Switch back. Odds are, the sound will be silenced upon returning to the QT
- movie. I don't know how to solve this problem.
-
- Unless the "delay" tactic mentioned earlier is successful, the only thing
- you can do is to complain to MacDTS until you get a reasonable response.
- They're not very forthcoming about Mac sound internals, but be specific with
- your problem and maybe you can get a workaround.
-
- _Dan
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Organization: Kalamazoo College
- Date: Mon, 5 Oct 1992 13:09:14 GMT
-
- dan@chaos.cs.brandeis.edu (Dan Schwarz) writes:
- >
- >* the Mac LC uses a crippled version of the Apple Sound Chip. So does the LC II
- >and Classic II, by the way. Major difference is that this chip can only handle
- >monophonic sound output, and cannot support simultaneous sound recording &
- >playback.
-
- Hmmm. Well, the preliminary developer note for the LC (I seem to have
- lost the final :-) says it "implements a subset of the ASC," but I think
- it would more accurately be described as really simple hardware and a
- Sound Manager that tries to make up for it.
-
- Another difference is that the LC doesn't support the 4-channel
- wavetable mode, which is part of the ASC. (But does the Sound Manager
- recognize an ASC and use it for 4-channel wavetables? Theoretically,
- four waveTableSynth channels should take almost no CPU time. Has anyone
- checked this out?)
-
- Later, it says "The sound system is similar to the Plus and SE sound
- systems in that main memory is used for the sound buffer. Because the
- Macintosh LC computer's video modes have different line times...the
- sound system has its own timing chain, which samples at the same
- rate..." Later it explains that this stuff is built into the V8 gate
- array, which appears to be a catch-all custom chip to do a hodgepodge of
- things that lots of little chips used to take care of. (You can see by
- my language that I'm not a hardware person. :-)
-
- Anyway, it looks like "subset of the ASC" is misleading. I'd call it a
- "simulation of the chintzy RAM-sampling technique used by the original
- 128K Mac, plus sound input, all tied together by the much-overworked
- Sound Manager."
-
- Can anyone who knows more about the LC, and hardware in general, expound
- on this?
-
- >* the System 6.0.7 and 6.0.6 sound managers have MAJOR bugs, especially when
- >dealing with the LC.
-
- Well, I don't know about the LC in particular, but those sound managers
- in general are a _lot_ more trustworthy than in previous versions.
-
- >Unless the "delay" tactic mentioned earlier is successful, the only thing
- >you can do is to complain to MacDTS until you get a reasonable response.
-
- I was going to suggest using a custom double-buffering routine, but I've
- never done it myself so I can't give advice. I'd try that before
- calling up MacDTS though.
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- "I don't think we should have to have them wandering the streets
- frightening women and people." - Pat Buchanan
-
- +++++++++++++++++++++++++++
-
- From: johnsd2@vccsouth07.its.rpi.edu (Daniel Norman Johnson)
- Date: 5 Oct 92 15:34:34 GMT
- Organization: Rensselaer Polytechnic Institute, Troy, NY.
-
- In article <1992Oct5.022712.3448@news.cs.brandeis.edu>, dan@chaos.cs.brandeis.edu (Dan Schwarz) writes:
- |> In article <w=mz_wc@rpi.edu> johnsd2@rpi.edu writes:
- |> >I am having a problem with an extension I am writing. This extension
- |> >is really a background app (type='appe'), which plays sounds asynchronously
- |> >in the background (which sounds are specified with annother program, that
- |> >works);
- |> ...
- |> >This strange freeze happens on a friends LC whenever
- |> >the sound is played, even from an APPL. (but only if its
- |> >asynchronously)
- |>
- |> Speaking as a programmer who has done some SERIOUS sound manager hacking,
- |> I can sympathize with your frustration. Here's what I can tell you:
- |>
- |> * the Mac LC uses a crippled version of the Apple Sound Chip. So does the LC II
- |> and Classic II, by the way. Major difference is that this chip can only handle
- |> monophonic sound output, and cannot support simultaneous sound recording &
- |> playback.
-
- Im just using SndPlay(blah,blah,True); to do this; It should be monophonic
- and (for these sounds) just ordinary sampled sound. I think.
-
- |> * the System 6.0.7 and 6.0.6 sound managers have MAJOR bugs, especially when
- |> dealing with the LC. These systems' sound input managers were taken directly
- |> from alpha versions of System 7.0 (in the rush to ship the first LC and IIsi
- |> units.) Don't trust the Gestalt values they return, for example.
-
- I don't. I dont even call Gestalt, and I dont use sound Input. Could you
- be a little more specific about the bugs, that is any bugs that might
- louse up asynchronous sound playback?
-
- |> * Use 7.0 or later versions, but this won't solve all your problems. I am
- |> convinced that there are hardware or software bugs in Apple's handling of
- |> this particular sound chip. For example, play back a QuickTime movie with
- |> sound (in SimplePlayer or any similar product.) Switch out of the layer
- |> into a product which does sound recording or otherwise uses the sound manager.
- |> Switch back. Odds are, the sound will be silenced upon returning to the QT
- |> movie. I don't know how to solve this problem.
-
- Bleah. No, make that Double-bleah.
-
- |> Unless the "delay" tactic mentioned earlier is successful, the only thing
- |> you can do is to complain to MacDTS until you get a reasonable response.
- |> They're not very forthcoming about Mac sound internals, but be specific with
- |> your problem and maybe you can get a workaround.
-
- Ill try to boost the delay, but it already has some delay in it- specificly
- it calls WaitNextEvent so it cant start the next sound until that comes
- back (which should be good for a few ticks, anyway.) So I dont know about
- that. (I cant do it right now, cuz my roommates asleep. :( )
-
- In any case, the latest version of it always closes the sound channel and opens
- it again before each sound. This has teh spiffy effect that it can now
- plays sounds after the Spanish Inquisition (but that does not play). So its
- getting better. No progress on teh autodoubler problem tho.
-
- - --
- - Dan Johnson
- And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
-
- These opinions have had all identifiying marks removed, and are untraceable.
- You'll never know whose they are.
-
- +++++++++++++++++++++++++++
-
- From: johnsd2@vccsouth07.its.rpi.edu (Daniel Norman Johnson)
- Organization: Rensselaer Polytechnic Institute, Troy, NY.
- Date: Mon, 5 Oct 1992 15:37:50 GMT
-
- In article <1992Oct5.130914.28967@hobbes.kzoo.edu>, k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
- |> dan@chaos.cs.brandeis.edu (Dan Schwarz) writes:
- |> >
- [deletia- details on LC ASC]
- |>
- |> >Unless the "delay" tactic mentioned earlier is successful, the only thing
- |> >you can do is to complain to MacDTS until you get a reasonable response.
- |>
- |> I was going to suggest using a custom double-buffering routine, but I've
- |> never done it myself so I can't give advice. I'd try that before
- |> calling up MacDTS though.
-
- Waitaminute. I thot double buffering was a trick you could do
- to play direct from disk... if not, what is it?
-
- - --
- - Dan Johnson
- And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
-
- These opinions have had all identifiying marks removed, and are untraceable.
- You'll never know whose they are.
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Date: 6 Oct 92 10:32:39 GMT
- Organization: Kalamazoo College
-
- ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
- >(Jamie R. McCarthy) writes:
- >>
- >> Well, I don't know about the LC in particular, but [the 6.0.6&7 SMs]
- >> in general are a _lot_ more trustworthy than in previous versions.
- >
- >I know of one major snag with the 6.0.7 Sound Manager. ... I had a brief
- >chance to check it myself, and discovered that it was dying in the resume loop.
- >
- >Idea: perhaps it has something to do with spurious invocation of my callback
- >routine. I recall Jim Reekes mentioning that this was possible, though I
- >don't recall what the precise conditions were.
-
- Someone else mentioned once that your callback can get called
- inappropriately under 6.0.4 (or was it .5?), so I always check in my
- routines. (My technique, for what it's worth, is to put an identifying
- constant in param1 and my app's A5 in param2.)
-
- If you can get that 4-voice-harmony XCMD to work under 6.0.7, Lawrence,
- a lot of people in the music-education biz would be very grateful. :-)
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- Memo to myself:
- Do The Dumb Things I Gotta Do.
- Touch The Puppet Head.
-
- +++++++++++++++++++++++++++
-
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Organization: Kalamazoo College
- Date: Tue, 6 Oct 1992 12:49:41 GMT
-
- johnsd2@rpi.edu writes:
- >Jamie R. McCarthy writes:
- >> I was going to suggest using a custom double-buffering routine, but I've
- >> never done it myself so I can't give advice. I'd try that before
- >> calling up MacDTS though.
- >
- >Waitaminute. I thot double buffering was a trick you could do
- >to play direct from disk... if not, what is it?
-
- To quote IM VI 22-72: "The play-from-disk routines make extensive use
- of the SndPlayDoubleBuffer function. ... By using SndPlayDoubleBuffer
- ...you can specify your own doubleback procedure (that is, the algorithm
- used to switch back and forth between buffers) and customize several
- other buffering parameters. Note: SndPlayDoubleBuffer is a very
- low-level routine and is not intended for general use. You should use
- SndPlayDoubleBuffer only if you require very fine control over double
- buffering."
-
- Double buffering will allow you to play sounds back-to-back,
- continuously. You can get the sounds directly from disk if that's what
- your doubleback procedure does; or, you can synthesize them, read them
- from RAM, whatever.
-
- The initial question (I think?!) was about playing some sounds
- back-to-back. Double-buffering will let you do that too (though, if you
- have the RAM, and you don't mind BlockMove()ing it around, it's easier
- to set up a SoundHeader with the combined data).
- - --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- I tried to sleep my way to the top
- But my alarm clock always woke me right up
-
- +++++++++++++++++++++++++++
-
- From: zobkiw@world.std.com (Joe Zobkiw)
- Date: 6 Oct 92 12:37:04 GMT
- Organization: The World Public Access UNIX, Brookline, MA
-
- << If you can get that 4-voice-harmony XCMD to work under 6.0.7, Lawrence,
- a lot of people in the music-education biz would be very grateful. :-)
- >>
-
- I wrote an XCMD called PlayChord about 3 years ago that is still available
- on America Online and other places. The latest version on AOL is 1.5.1. It
- uses the square-wave synth if memory serves and will play up to 4 notes
- simultaneously using any of a number of waveforms (you can even create your
- own, however, they are limited to 256 'steps' per waveform).
-
- This was originally written under 6.0.5 with THINK Pascal at the time
- and seems to even work fine on my Radius Rocket under 7.0.1! Now _that_
- is truly portable code ;)
-
- If anyone is interested I'd be glad totry and dig up the source although
- I probably won't be proud of it anymore!
-
- Check out the XCMD if any of you get a chance and drop me a line telling
- me your thoughts.
-
-
- - --
- - -------------------------------------------------------------
- joe zobkiw zobkiw@world.std.com aol: aflzobkiw
-
- macintosh.midi.synthesis.c.oop.asm.communications.graphics...
-
- +++++++++++++++++++++++++++
-
- From: johnsd2@rs6219.ecs.rpi.edu (Daniel Norman Johnson)
- Organization: Rensselaer Polytechnic Institute, Troy, NY.
- Date: Tue, 6 Oct 1992 20:06:12 GMT
-
- In article <1992Oct6.124941.16821@hobbes.kzoo.edu>, k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
- |> johnsd2@rpi.edu writes:
- |> >Jamie R. McCarthy writes:
- |> >> I was going to suggest using a custom double-buffering routine, but I've
- |> >> never done it myself so I can't give advice. I'd try that before
- |> >> calling up MacDTS though.
- |> >
- |> >Waitaminute. I thot double buffering was a trick you could do
- |> >to play direct from disk... if not, what is it?
- |>
- |> To quote IM VI 22-72:
- [deletia- and he does, too]
- |>
- |> Double buffering will allow you to play sounds back-to-back,
- |> continuously. You can get the sounds directly from disk if that's what
- |> your doubleback procedure does; or, you can synthesize them, read them
- |> from RAM, whatever.
- |>
- |> The initial question (I think?!) was about playing some sounds
- |> back-to-back. Double-buffering will let you do that too (though, if you
- |> have the RAM, and you don't mind BlockMove()ing it around, it's easier
- |> to set up a SoundHeader with the combined data).
-
- Well, actually it had to do with playing sound asynchronously. They
- are never played completely back to back (it doesnt play while
- loading the next sound) and may be played with hours between the sounds.
-
- - --
- - Dan Johnson
- And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
-
- These opinions have had all identifiying marks removed, and are untraceable.
- You'll never know whose they are.
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-